#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time      :2022/6/2 14:04
# @Author    :cjw
import allure
from appium.webdriver.common.appiumby import AppiumBy

from app_wework.base.base_page import BasePage
from app_wework.util.log import logger


class MainPage(BasePage):
	"""主页面"""

	__BTN_CONTACT_LIST = (AppiumBy.XPATH, '//*[@text="通讯录"]')  # “通讯录”菜单

	def goto_contact_list(self):
		"""跳转到通讯录页面"""
		from app_wework.page.contact_list_page import ContactListPage

		with allure.step(msg := '点击“通讯录”菜单，跳转到通讯录页面'):
			logger.info(msg)
			self.find_click(self.__BTN_CONTACT_LIST)
		return ContactListPage(self.driver)
